<!DOCTYPE html>
<html>
<head>
    <title>测试jsApis</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
          charset="UTF-8"/>

    <script src="../js/vconsole.min.js"></script>
    <script>
    // 初始化
    var vConsole = new VConsole();
    console.log('init vConsole');
    </script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            text-align: center;
        }

        .btn {
            line-height: 34px;
            text-align: center;
            font-size: 14px;
            border: 1px solid #a83939;
            background-color: #fff;
            margin-bottom: 20px;
            padding: 0 10px;
        }

        .message {
            position: fixed;
            bottom: 0;
            width: 100%;
            padding: 10px;
            font-size: 14px;
            color: #000;
        }

    </style>

</head>
<body>
<div class="box">
    <div class="message" id="message1" style="background-color: chocolate"></div>
    <button class="btn" onclick="getChatBotInitParams()">getChatBotInitParams</button>
    <button class="btn" onclick="shareLink()">shareLink</button>
    <br/>
    <button class="btn" onclick="cacheLastPageInfo()">cacheLastPageInfo</button>
    <br/>
    <button class="btn" onclick="contactListWithSendMoney()">contactListWithSendMoney</button>


    <div class="message" id="message" style="background-color: chocolate"></div>

    <br/>


    <br/>
</div>
<script>



function getChatBotInitParams() {

    JSBridge.call('getChatBotInitParams', {

    }, function(result) {
        document.getElementById('message').innerHTML = JSON.stringify(result);
        console.log(JSON.stringify(result));
    });
}

function cacheLastPageInfo() {


    JSBridge.call('cacheLastEntryPageInfo', {
        "ReferenceNo": "ReferenceNo", "DateAndTime": "DateAndTime",
        "Total": "Total", "TransactionStatus": "TransactionStatus"
    });
}

function contactListWithSendMoney() {

    JSBridge.call('contactListWithSendMoney', {

    }, function(result) {
        document.getElementById('message').innerHTML = JSON.stringify(result);
        console.log(JSON.stringify(result));
    });
}

var shareNums = 0;
function shareLink() {

//    Key    Character
//    title   string
//    desc    string
//    icon    string
//    type    string  IMAGE/TXT/URL/DEEP_LINK
//    data    string

    var title = ""
    var desc = ""
    var icon = ""
    var type = "TXT"
    var data = ""

    shareNums++;
    if (shareNums > 5)
    {
        shareNums = 1
    }
    if (shareNums == 1)
    {
        //文本
        title = "share text title"
        desc = "share desc"
        type = "TXT"
        data = "share text content"
        icon = ""
    }
    else if(shareNums == 2)
    {
        //文本带自定义图标
        title = "share text title"
        desc = "share desc with js icon"
        type = "TXT"
        data = "share text content"
        icon = "iVBORw0KGgoAAAANSUhEUgAAAEAAAABAEAYAAAD6+a2dAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAEitJREFUeNrtnHl0FFW+x79V1d1VvSTdSXfSWcmqSScQEgwJCBIWURPFUURUcs44gG/UQUcR9Okgcs5zgfPcxXd8LjAMKMhoFJRNHBEwQAibCSAJECEJ2Uln66W6q6vq/XGnTuL2TNKdgNiff37pStWtW7d+997f73d/t4AgQYIECRIkSJAgQYIECRIkSJAgQYJc+VCXugKBwWQiMiGByNhYIsPDFal9mamkWqKitOPU21RjTSbudvWzjJZlxRrxEfFkaKinRcyWV/l8zBO0jAk8T79BLaSbPR5via9CXuzzuddIeeL55mbvMd85qbO1lZTb3k5kWxuR9fVEXrhApCBc6pb5NS5zBcjIIHLCBOYOaiMwdqxmNpNJ/+Xaa32vSVPlfyQlCQekVtmp01H/fhLDFM0IlcXnM93O2VQWwLyKO6ZpVKlCQ1lWpQI0Goah+jy1waBWq1QATZOjPC+KkgR4vUQq9PR4vaIIdBbwcUKYJHXU892CW5Y7v/DU+uwU5bWLbslL0xRN0YAsc3uYWcwUu13dRM/CrhMneoqEIpH65hvZIBuAQ4dIqXv2ENnVdala+DJRgPR0aju1HXj4YY2Ofo/OnznTUyCWSAejoqI8+sfYm9zunAtWZ6ibZTPfshwz1NH0iBFGI8cBcXEhIRwHxMQYDBwHqNXKqxxeurs9Hp8PqK/v6eF5oL6+u5vnge+/7+x0uYDK69rie8Ik6cTLbQcddZ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VYdGRhdGU6Y3JlYXRlADIwMjEtMDgtMTNUMTQ6MTQ6NDYrMDg6MDALhodzAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIxLTA4LTEzVDE0OjE0OjQ2KzA4OjAwets/zwAAAEh0RVh0c3ZnOmJhc2UtdXJpAGZpbGU6Ly8vaG9tZS9hZG1pbi9pY29uLWZvbnQvdG1wL2ljb25fa2x0c2pxb2NzMi9idWRpbmcuc3ZnzLTh0wAAAABJRU5ErkJggg=="
    }
    else if(shareNums == 3)
    {
        //URL
        title = "share link title"
        desc = "share desc with link"
        type = "URL"
        data = "https://www.baidu.com"
        icon = ""
    }
    else if(shareNums == 4)
    {
        //IMAGE
        title = "share image title"
        desc = "share desc with image"
        type = "IMAGE"
        data = "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fcdn.duitang.com%2Fuploads%2Fitem%2F201412%2F15%2F20141215151225_kQSkZ.thumb.700_0.jpeg&refer=http%3A%2F%2Fcdn.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1631428526&t=8f72c038a281f00518e2f33f5ccbf718"
        icon = ""
    }
    else if(shareNums == 5)
    {
        //URL
        title = "share link title"
        desc = "share desc with link"
        type = "DEEP_LINK"
        data = "https://www.baidu.com"
        icon = ""
    }

    JSBridge.call('shareLink', {"title":title,"desc":desc, "icon":icon,"type":type,"data":data});
}

</script>

</body>
</html>
